#ifndef __BWT_H__
#define __BWT_H__

#include"Index.h"

char getCharFromQueries(unsigned int * Queries, unsigned int queryId, unsigned int pos);
unsigned int getCountValue(BWT* bwt, char baseId);
unsigned int getOccValue(BWT *bwt, unsigned int pos,char baseId);
void getAllOccValue(BWT *bwt,unsigned int pos,unsigned int*result);

bool bwtCalc(BWT *bwt, char baseId, unsigned int * start, unsigned int * end);
bool bwtCalcWithOccValue(unsigned int *countValue, char baseId,
						 unsigned int startOccValue,unsigned int endOccValue, unsigned int * start, unsigned int * end);	

//bool bwtCalc(BWT *bwt, char *occCountMap, char baseId, unsigned int * start, unsigned int * end);
bool bwtCalcWithOccValue(unsigned int *countValue, char baseId,
						 unsigned int startOccValue,unsigned int endOccValue, unsigned int * start, unsigned int * end);
bool BackwardSearch(BWT *bwt, unsigned int * Queries, unsigned int queryId, unsigned int lower, unsigned int upper, 
					unsigned int * temp_start, unsigned int * temp_end);
bool ForwardSearch(BWT* revbwt, unsigned int * Queries, unsigned int queryId, unsigned int lower, unsigned int upper, 
				   unsigned int *temp_rev_start, unsigned int *temp_rev_end, 
				   unsigned int *temp_start, unsigned int* temp_end);

#endif




